import { Commit } from 'vuex';
import { getIview } from '@/axios/api';
export interface State {
    userName: string,
}
const state: State = {
    userName: '零零三',
};

const mutations: any = {
    setName(states: any, name: string) {
        states.userName = name;
    },
};

const actions: any = {
    setName(context: { commit: Commit }, name: string) {
        context.commit('setName', name);
    },
    async getIview() {
        await getIview().then(
            (res: any): void => {
                //    debugger
            }
        );
    }
};

export default {
    namespaced: true, // namespaced为false的时候，state,mutations,actions全局可以调用，为true，生成作用域，引用时要声明模块名称
    state,
    mutations,
    actions
};
